support cross-compiling for windows_arm64#7002
Conversation
|
Please add a CI test for this here: https://github.com/BOINC/boinc/blob/master/.github/workflows/mingw.yml |
There was a problem hiding this comment.
2 issues found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/Makefile.mingw">
<violation number="1" location="lib/Makefile.mingw:104">
P2: `OS_WINARM64` is gated in `Makefile.mingw` but not defined for this build path, so `stackwalker_win.o` may still be built on win_arm64.</violation>
</file>
<file name="lib/Makefile.am">
<violation number="1" location="lib/Makefile.am:86">
P1: `win_sources +=` is missing a continuation backslash, causing `stackwalker_win.cpp` to be parsed as an invalid standalone makefile line.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Pull request overview
Enable cross-compiling BOINC libraries for Windows ARM64 (e.g., --host=aarch64-w64-mingw32, --with-boinc-platform=windows_arm64) by gating x86-only stack-walking/debugger-extension code paths and fixing a Windows header typedef dependency.
Changes:
- Add an Autoconf conditional (
OS_WINARM64) intended to identify Windows ARM64 builds and use it to exclude x86-only stack-walking sources. - Disable/circumvent callstack dump initialization on ARM64/aarch64 in
diagnostics_win.cpp. - Include
<stddef.h>forsize_twhen definingsocklen_ton Windows.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/diagnostics_win.cpp | Avoids initializing/using stack-walking/debugger extensions on aarch64 targets and adjusts the unsupported warning. |
| lib/boinc_win.h | Adds <stddef.h> so size_t is available when defining socklen_t. |
| lib/Makefile.mingw | Excludes stackwalker_win.o when building for Windows ARM64 via a make-time flag. |
| lib/Makefile.am | Attempts to exclude stackwalker_win.cpp from Windows builds on ARM64 via Automake conditionals. |
| configure.ac | Introduces the OS_WINARM64 conditional to drive ARM64-specific build gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/mingw.yml">
<violation number="1" location=".github/workflows/mingw.yml:77">
P1: Unverified external llvm-mingw toolchain download is extracted and added to PATH without checksum/signature validation, creating a CI supply-chain risk.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| run: | | ||
| sudo apt-get install -y mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev mingw-w64-i686-dev | ||
|
|
||
| - name: Install aarch64 llvm-mingw toolchain |
There was a problem hiding this comment.
Is there any system package that provides the same executables? I prefer to not stich to a particular version, expecially from the GitHub repo that doesn't look like something more or less official (neither gcc not clang).
There was a problem hiding this comment.
Understand, but unfortunately, there’s no system package like mingw-w64-aarch64-dev available. This toolchain is recommended on the official website https://www.mingw-w64.org/downloads/ (LLVM-MinGW)
| std::set_terminate(boinc_term_func); | ||
| std::set_unexpected(boinc_term_func); | ||
| #ifndef __aarch64__ | ||
| std::set_unexpected(boinc_term_func); |
There was a problem hiding this comment.
It's been deprecated since c++11 https://runebook.dev/en/docs/cpp/error/set_unexpected
It might be worth revisiting.
|
Looks fine to me. |
support cross-compiling for windows_arm64
Description of the Change
fixes a few issues to allow cross-compiling libraries for --host=aarch64-w64-mingw32 --with-boinc-platform="windows_arm64"
https://github.com/mstorsjo/llvm-mingw/releases
Alternate Designs
Visual Studio works well, but many existing projects rely on GCC / Clang, and porting them to Visual Studio isn’t always straightforward.
Release Notes
N/A
Summary by cubic
Enable cross-compiling BOINC libraries for Windows ARM64 with MinGW/Clang (
--host=aarch64-w64-mingw32,--with-boinc-platform=windows_arm64). CI builds x86_64 and ARM64 libs on Ubuntu usingmingw-w64/llvm-mingw, verifies thellvm-mingwchecksum, and tags artifacts/logs by arch.New Features
OS_WINARM64and detectAARCH64_BUILDinlib/Makefile.mingw.stackwalker_win.cppon ARM64 (Autotools and Makefile guards).WINVER/_WIN32_WINNTdefines; drop legacy cross-build defines.std::set_unexpectedand callstack dumps on__aarch64__.<stddef.h>forsocklen_t.CI
arch(x86_64,aarch64) with per-arch toolchains (mingw-w64,llvm-mingw).llvm-mingw20260421, verify SHA-256, add toPATHfor ARM64.apps-mingw-vcpkgandlibs-mingw-cmakeon ARM64.arch.Written for commit 91ccb8d. Summary will update on new commits.